package com.joker.aigc.chat.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.joker.aigc.chat.domain.entity.RoomGroup;
import com.joker.aigc.chat.service.RoomGroupService;
import com.joker.aigc.chat.mapper.RoomGroupMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 20346
 * @description 针对表【room_group(群聊房间表)】的数据库操作Service实现
 * @createDate 2023-12-17 11:26:08
 */
@Service
public class RoomGroupServiceImpl extends ServiceImpl<RoomGroupMapper, RoomGroup> implements RoomGroupService {


    @Override
    public List<RoomGroup> listByRoomIds(List<Long> roomIds) {
        return lambdaQuery()
                .in(RoomGroup::getRoomId, roomIds)
                .list();
    }

    @Override
    public RoomGroup getRoomGroupByRoomId(Long roomId) {
        return lambdaQuery()
                .eq(RoomGroup::getRoomId, roomId)
                .one();
    }



}




